import {Injectable} from "@angular/core";
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import {Http} from "@angular/http";
import {UrlData} from "../../common/urldata";
import {ExceptionHandler} from "../../common/exception.handler";
/**
 * 收藏
 */
@Injectable()
export class SmsService {

  constructor(private http: Http,
              private urlData: UrlData,
              private exceptionHandler: ExceptionHandler) {
  }

  sendVerificationCode(params: any) {
    return this.http
      .post(this.urlData.baseUrl + `v1/sms/send`, params)
      .map(response => response.json()).catch(err =>
        this.exceptionHandler.handleError(err)
      );
  }
}
